package HBaseDemo.HBase2HBase;

import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.mapreduce.TableReducer;
import org.apache.hadoop.io.NullWritable;

import java.io.IOException;

public class H2HReducer extends TableReducer<ImmutableBytesWritable, Put, NullWritable> {
    //<KEYIN, VALUEIN, KEYOUT>

    @Override
    protected void reduce(ImmutableBytesWritable key, Iterable<Put> values, Context context) throws IOException, InterruptedException {
        //把put里的数据迭代遍历写出
        for (Put value : values) {
            context.write(NullWritable.get(), value);

        }
    }
}
